import request from "@/utils/request";

/**
 * 获取创建人列表
 */
export const createUserList = props => {
  return request({
    url: "/mall/tenant/merchant/inboundOrder/createUserList",
    method: "post",
    data: props
  });
};
/**
 * 获取入库单列表
 */
export const getPageApi = props => {
  return request({
    url: "/mall/tenant/merchant/inboundOrder/page",
    method: "post",
    data: props
  });
};
/**
 * 清单查询接口
 */
export const listDetails = props => {
  return request({
    url: `/mall/tenant/merchant/inboundOrder/listDetails/${props.inboundId}`,
    method: "get"
  });
};
/**
 * 清单查询接口
 */
export const inboundOrderDetail = props => {
  return request({
    url: `/mall/tenant/merchant/inboundOrder/${props.inboundId}`,
    method: "get",
    params: props
  });
};
//查看物流详情
export const findOrder = props => {
  return request({
    url: "/mall/kuaidi100/findOrder",
    method: "get",
    params: props
  });
};
//确认入库
export const submitInboundOrder = props => {
  return request({
    url: "/mall/tenant/merchant/inboundOrder/inboundOrder",
    method: "post",
    data: props
  });
};
//确认异常处理
export const abnormalHandle = props => {
  return request({
    url: "/mall/tenant/merchant/inboundOrder/abnormalHandle",
    method: "post",
    data: props
  });
};
//查询商品
export const pageByKeyword = props => {
  return request({
    url: "/mall/tenant/merchant/product/pageByKeyword",
    method: "post",
    data: props
  });
};
//商品详情
export const getShopDetail = data => {
  return request({
    url: "/mall/shopHome/product",
    method: "post",
    headers: {
      "Content-Type": "multipart/form-data"
    },
    data
  });
};
//暂存选中的商品
export const saveTempProduct = props => {
  return request({
    url: "/mall/tenant/merchant/inboundOrder/saveTempProduct",
    method: "post",
    data: props
  });
};
//查询暂存的商品list
export const getTempProductSkuList = props => {
  return request({
    url: "/mall/tenant/merchant/inboundOrder/getTempProductSkuList",
    method: "post",
    data: props
  });
};
//删除暂存的商品row
export const delTempProductSku = props => {
  return request({
    url: "/mall/tenant/merchant/inboundOrder/delTempProductSku",
    method: "post",
    data: props
  });
};

//创建入库单
export const newInboundOrder = props => {
  return request({
    url: "/mall/tenant/merchant/inboundOrder/newInboundOrder",
    method: "post",
    data: props
  });
};
//分页查询供应商列表
export const getProvideList = props => {
  return request({
    url: `/mall/tenant/merchant/tenant/getProvideList?current=${props.current}&size=${props.size}`,
    method: "post",
    data: props
  });
};

//导出
export const download = props => {
  return request({
    url: "/mall/tenant/merchant/inboundOrder/download",
    method: "post",
    responseType: "blob",
    data: props
  });
};

//保存入库备注
export const saveRemark = props => {
  return request({
    url: "/mall/tenant/merchant/inboundOrder/saveRemark",
    method: "post",
    data: props
  });
};
